<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
</head>
<style>
    .menu1:before {
        content: url(../image/menu-submit.png);
    }

    .menu2:before {
        content: url(../image/menu-allList.png);
    }

    .menu3:before {
        content: url(../image/menu-execute.png);
    }

    .menu4:before {
        content: url(../image/menu-repaire.png);
    }

    .menu5:before {
        content: url(../image/menu-allList2.png);
    }

    .menu6:before {
        content: url(../image/menu-equip20.png);
    }

    .menu7:before {
        content: url(../image/submit.png);
    }

    .infoClock:before {
        content: url(../image/massage2.png);
    }

    .headPhoto:after {
        content: url(../image/my.png); //headPhoto
    }

    .equipCount:before {
        content: url(../image/equipCount.png);
    }
</style>

<body>
    <!-- <header class="aui-bar aui-bar-nav ui-selectee" >admin</header> -->
    <!-- <footer class="aui-bar aui-bar-tab ui-selectee">
        <div class="aui-bar-tab-item sortable aui-active ui-selectee ui-sortable"> <i class="aui-iconfont aui-icon-home ui-selectee" datatype="icon"></i>
            <div class="aui-bar-tab-label ui-selectee">首页</div>
        </div>
        <div class="aui-bar-tab-item sortable ui-selectee ui-sortable"> <i class="aui-iconfont menu6 ui-selectee" datatype="icon"></i>
            <div class="aui-bar-tab-label ui-selectee">设备</div>
        </div>
        <div class="aui-bar-tab-item sortable ui-selectee ui-sortable"> <i class="aui-iconfont aui-icon-my ui-selectee" datatype="icon"></i>
            <div class="aui-bar-tab-label ui-selectee">我的</div>
        </div>
    </footer> -->
    <div class="aui-card-list ui-selectee">
        <div class="aui-card-list-content sortable ui-selectee ui-sortable" style="background: url('../image/di.png') no-repeat;background-size: 100%;height:180px;line-height:160px;text-align:center;vertical-align:middle;">
            <div style="width:100%;float:left;line-height: 20px;height: 40%;">
                <div style="width:33%;float:left">
                    <i class="aui-iconfont aui-icon-left ui-selectee" datatype="icon" style="float: left;top: 20px;left:2px;font-size: 0.8rem;color: #f5f5f5;" id="userName" onclick="closeWin();"></i>
                    <!-- <i class="aui-iconfont aui-icon-left ui-selectee" datatype="icon" style="float: left;top: 30px;left:20px;">
                      <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
                          <span class="aui-iconfont aui-icon-left"></span>
                      </a>
                    </i> -->
                </div>
                <div style="width:33%;float:left">
                    <!-- <i class="aui-iconfont headPhoto ui-selectee" datatype="icon" style="float: initial;top: 20px;font-size: 0.9rem;color: #f5f5f5;" id="userName"></i> -->
                </div>
                <div style="width:33%;float:right">
                    <i class="aui-iconfont infoClock ui-selectee" datatype="icon" style="float: right;top: 20px;right:20px;font-size: 0.9rem;color: #f5f5f5;" id="userName"></i>
                </div>
            </div>
            <div style="width:100%;float:left;line-height: 50%;height: 60%;">
                <div class="aui-col-xs-6 sortable ui-selectee ui-sortable">
                    <i class="aui-iconfont equipCount ui-selectee" datatype="icon"></i>
                    <div class="aui-bar-tab-label ui-selectee" style="font-size: 0.8rem;color: #f5f5f5;margin-top: 12px;">设备总数</div>
                    <div class="aui-grid-label ui-selectee" style="font-size: 1rem;color: #f5f5f5;margin-top: 15px;" id="countAll"></div>
                </div>
                <div class="aui-col-xs-6 sortable ui-selectee ui-sortable">
                    <i class="aui-iconfont equipCount ui-selectee" datatype="icon"></i>
                    <div class="aui-bar-tab-label ui-selectee" style="font-size: 0.8rem;color: #f5f5f5;margin-top: 12px;">实时故障</div>
                    <div class="aui-grid-label ui-selectee" style="font-size: 1rem;color: #f5f5f5;margin-top: 15px;" id="countFault"></div>
                </div>
            </div>
        </div>
    </div>
    <section class="aui-grid aui-margin-b-15 ui-selectee">
        <div class="aui-title" id="title">
            设备故障
        </div>
        <div class="aui-row ui-selectee">
            <div class="aui-col-xs-4 sortable ui-selectee ui-sortable" onclick="goPage('emequipmentfault');"> <i class="aui-iconfont menu1 ui-selectee" datatype="icon"></i>
                <div class="aui-grid-label ui-selectee">故障提报</div>
            </div>
            <div class="aui-col-xs-4 sortable ui-selectee ui-sortable" onclick="goPage('emequipmentfaultSubmitList');"> <i class="aui-iconfont menu7 ui-selectee" datatype="icon"></i>
                <div class="aui-grid-label ui-selectee">已提报</div>
            </div>
            <div class="aui-col-xs-4 sortable ui-selectee ui-sortable" onclick="goPage('emequipmentfaultList');"> <i class="aui-iconfont menu2 ui-selectee" datatype="icon"></i>
                <div class="aui-grid-label ui-selectee">全部单据</div>
            </div>
        </div>
    </section>
    <section class="aui-grid aui-margin-b-15 ui-selectee">
        <div class="aui-title" id="title">
            设备维修
        </div>
        <div class="aui-row ui-selectee">
            <div class="aui-col-xs-4 sortable ui-selectee ui-sortable" onclick="goPage('emequipmentfaltToExecuted');"> <i class="aui-iconfont menu3 ui-selectee" datatype="icon"></i>
                <div class="aui-grid-label ui-selectee">待执行</div>
            </div>
            <div class="aui-col-xs-4 sortable ui-selectee ui-sortable" onclick="goPage('emequipmentfaultRepaireList');"> <i class="aui-iconfont menu4 ui-selectee" datatype="icon"></i>
                <div class="aui-grid-label ui-selectee">维修</div>
            </div>
            <div class="aui-col-xs-4 sortable ui-selectee ui-sortable" onclick="goPage('emequipmentfaultRepaireAllList');"> <i class="aui-iconfont menu5 ui-selectee" datatype="icon"></i>
                <div class="aui-grid-label ui-selectee">全部单据</div>
            </div>
        </div>
    </section>
</body>
<script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
<script>
    function closeWin() {
        api.closeWin({});
    }
    apiready = function() {
            var un = localStorage.getItem('un');
            //$("#userName").html(un);
            //获取设备总数、当前故障的设备数
            getEmequipmentfaultDataInfo();


        }
        //获取设备总数、当前故障的设备数
    function getEmequipmentfaultDataInfo() {
        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getEmequipmentCount";
        var data = {
            values: {
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            async: false,
            data: data
        }, function(ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                //返回成功
                if (myobj.code == "0") {
                    var countAll = eval(myobj.countAll);
                    var countFault = eval(myobj.countFault);
                    //console.log(countFault);
                    $("#countAll").html(countAll);
                    $("#countFault").html(countFault);

                    //失败
                } else if (myobj.code == "1") {
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }

    //跳转页面
    function goPage(name) {
        //打开页面
        api.openWin({
            name: name,
            url: name + '.html',
        });
    }
</script>

</html>
